package com.github.beihaifeiwu.myspring.template.beetl;

import com.github.beihaifeiwu.myspring.utils.EX;
import org.beetl.core.GroupTemplate;
import org.beetl.ext.spring.BeetlGroupUtilConfiguration;

import javax.servlet.ServletContext;

/**
 * Created by liupin on 2017/5/3.
 */
public class BeetlGroupConfiguration extends BeetlGroupUtilConfiguration {

    public BeetlGroupConfiguration(GroupTemplate groupTemplate) {
        this.groupTemplate = groupTemplate;
    }

    @Override
    public void init() {
        try {
            config(groupTemplate);
            initOther();
        } catch (Exception e) {
            EX.rethrow(e, "加载GroupTemplate失败");
        }
    }

    @Override
    public void setServletContext(ServletContext sc) {
        // skip process for root process preventing exception when MockMvc enabled
    }
}
